<?php
	namespace app\controllers;
	use yii\web\Controller;
	class SessionController extends Controller{
		public function actionIndex(){
			$session = \YII::$app->session;
			$session->open();
			if($session->isActive){
				echo "good<br>";
			}
			$session->set('user','sbbuser');
			$session->remove('user');//销毁user的session
			echo $session->get('user');

			echo $session['user'];//效果同上

			unset($session['user']);//销毁该session 
		}
	}
?>